import tpl from './index.tpl'
import './index.scss'
import { tplReplace } from '../../../utils/tools'
export default () => {
    return {
        name: 'page',
        tpl(data) {
            const oPage = document.createElement('div'),
                  pageHtml = this.renderPage(data)
            oPage.className = 'page'

            oPage.innerHTML = pageHtml
            return {
                oPage,
                pageHtml
            }
        },
        renderPage(data) {
            return tplReplace(tpl,{
                name: data.name
            })
        }
    }
}